{{render "header-layer.html"}}

{{js "/static/util/tinymce/tinymce.min.js" }}

<script type="text/javascript">

    var tinyMCE = tinymce.init({
        selector: '.tinymce-section',
        language: 'zh_CN',
        menubar: false,
        plugins: 'advlist autolink link image lists charmap preview',
        toolbar: [
            'bold italic underline strikethrough  | fontselect | fontsizeselect | formatselect  | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | removeformat| undo redo | link unlink image media insertdatetime table  hr pagebreak codesample | code fullscreen preview'
        ],
        setup: function (editor) {
            editor.on('change', function () { editor.save(); });
        },
        images_upload_url: '/admin/uploadify/editor'
    });

</script>
<div class="main">
    <div class="main_right">
        <div class="right_1">
            <div class="right_1_2">
                <div class="x-nav">
                    {{render "page-tool.html"}}
                </div>
                <form class="layui-form" action='{{urlpath "/admin/article/save"}}'>
                    <input type="hidden" name="id" value="{{.data.ID}}" />
                    <div class="layui-form-item">
                        <label class="layui-form-label">文章标题：</label>
                        <div class="layui-input-inline layui-input-inline-long">
                            <input name="title" type="text" maxlength="30" placeholder="请输入文章标题" lay-verify="required"
                                lay-reqText="请输入文章标题" value="{{.data.Title | html}}" class="layui-input">
                        </div>
                    </div>



                    <div class="layui-form-item">
                        <label class="layui-form-label">主图：</label>
                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn J_UploadImgBtn" data-itype="article" id="J_TitleImg">
                                <i class="layui-icon">&#xe67c;</i>更改图片
                            </button>
                            <img onerror="this.onerror=null;this.src='/static/images/default.png'"
                                data-img="{{if .data.Img }}{{.data.Img}} {{else}}/static/images/default.png{{end}}"
                                class="J_ViewImg upload-img" src="{{.data.Img}}">
                            <input name="img" type="hidden" value="{{.data.Img}}">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">简介：</label>
                        <div class="layui-input-inline layui-input-inline-longer">
                            <p class="de_tips">（选填，如果不填写会默认抓取正文前108个字）</p>
                            <textarea name="description" placeholder="请输入简介"
                                class="layui-textarea">{{.data.Description | html}}</textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">内容：</label>
                        <div class="layui-input-rich">
                            <textarea name="content" class="tinymce-section">
                                    {{htmlspecialchars_decode .data.Content}}
                            </textarea>
                        </div>
                    </div>

                    <div class="btn-box">
                        <button class="layui-btn layui-btn-lg" lay-submit lay-filter="saveBtn">确认保存</button>
                        <a class="layui-btn layui-btn-primary layui-btn-lg"
                            href="javascript:parent.layer.closeAll();">关闭窗口</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{{render "footer.html"}}